<?php
/*
 * File name : display_agency.php
 * Description : Payment page for downloading the searched Agency details.
 * Created By : Pratibha Awasthi
 */
include_once "basePage.php";

class Payment extends basePage{
	
	public function make_payment(){

		echo <<<EPRINT
		   	 <h2><br/> Payment Page </h2>
		   	 <br/> <br/>
			 <h4><br/> Processing your payment... </h4>
			 <br/> <br/>
			 <h4> Payment made Successfully !!!! </h4>
			 
            <form action = "" method = "post" name = "payment">  
            <!-- <input type = 'submit' name = 'submit' value = 'Download Agency Information'>-->
EPRINT;
						
    }
    
    public function create_pdf(){
		
    	session_start();
		$_SESSION['payment_made'] = 'true';
		
    	require("html2fpdf/html2fpdf.php"); 
    	
		$htmlFile = "http://localhost/good-mojo-donation/trunk/src/ReviewAgency.php";
		
		$buffer = file_get_contents($htmlFile);
		$pdf = new HTML2FPDF('P', 'mm', 'Legal');
		$pdf->AddPage();
		$pdf->WriteHTML($buffer);
		
		$filename = $_SESSION['agency_search'].'_Agency_Documents'.'.pdf';
		$file_location = 'html2fpdf/'.$filename;
		$pdf->Output($file_location, 'F');
		
		
		echo "<p><a href= 'DownloadPdf.php' ><h2> Download here </h2></a></p>";
    }
 
}


$page = new Payment();
$page->header();
$page->top_menu_donor();
$page->make_payment();
$page->create_pdf();
$page->footer();

?>